<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" href="../../component/pear/css/pear.css"/>
		<style>
			h1{
				margin-top: 200px;
				color: #5FB878;
			}
			.layui-card-body{
				text-align: center;height: 500px;
			}
		</style>
	</head>
	<body class="pear-container">
		<div class="layui-card">
			<div class="layui-card-header"></div>
			<div class="layui-card-body">
				<h1><b>此页面仅对辅导员开放</b></h1>
			</div>
		</div>
	</body>
	<script src="../../component/layui/layui.js"></script>
	<script src="../../component/pear/pear.js"></script>
<script>
	layui.use(['jquery'], function () {
		let $ = layui.jquery;
		$.ajax({
			url: '/admin/tea/getMyTeacherInfo',
			dataType: 'json',
			type: 'post',
			success: function (res) {
				console.log(res.data);
				//获取完整路径
				let curWwwPath = window.document.location.href;
				//获取主机地址之后的目录，如： index.jsp
				let pathName = window.document.location.pathname;
				let pos = curWwwPath.indexOf(pathName);
				//获取主机地址，如： http://localhost:8080
				let localhostPaht = curWwwPath.substring(0, pos);
				if (res.code === 0) {
					if (res.data[0].identityName === '辅导员') {
						window.location.replace(localhostPaht + "/user/view/system/leaveRecordOfTea.html");
					}
				}
			}
		})
	})

</script>
</html>
